<template>
  <div id="app">
    <div class="main">
      <!-- 路由视图 -->
      <!-- <keep-alive include="search"> -->
      <router-view @get-player-id="getPlayerId"  @get-play-all-id="getPlayAllId" @get-singer-id="getPlayerId"  @get-singer-all-id="getPlayAllId" @get-play-id="getPlayerId" @get-playmusic-id="getPlayerId" @get-playImg-id="getPlayerId"></router-view>
      <!-- </keep-alive> -->

      <!-- 播放器组件 -->
      <player v-show="playerId" :player-id="playerId" :list-id="listId" @set-player-id="setPlayerId"></player>
    </div>
  </div>
</template>

<script>
import player from "./components/base/player.vue";
export default {
  components: { player },
  data() {
    return {
      playerId: null,
      listId:null
    };
  },
  methods: {
    getPlayerId(id) {
      console.log("歌曲id", id);
      this.playerId = id;
    },
     getPlayAllId(id){
      console.log("歌单",id);
      this.listId = id;
    },
    setPlayerId(id){
      this.playerId = id;
    }
  },
};
</script>

<style lang="less">
@import "./assets/css/base.css";
</style>